批量查询【托工退回单】接口

概述

该接口主要用于第三方平台或自主研发者,需要通过日期、单号、部门批量查询ERP系统的单据时,则可调用该单据的批量查询接口,将Sunlike ERP或Online ERP系统中的批量单据信息查询到第三方平台中。

参数说明

请求方式

请求方式 POST
接口地址 http://ERPAPI站点/MRPBR/BATCHDATA
格式 JSON
编码类型 UTF-8

header参数

Content-Type application/json
Authorization token 授权接口所获取的值

请求参数

字段名称 字段代号 类型 长度 必填 固定值 备注
程序代号 PGM     MRPBR  
单据号码
TC_NO
String 20     ERP的单据号码,可多张单号,加中括号[],单号之间用逗号隔开,如”TC_NO”:”[TC2111050001],[TC2111050002]”
单据日期类型 DATE_TYPE String 1   0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
开始日期 START_DATE datetime       从开始日期开始查询单据,当单号为空时,日期必填
结束日期 END_DATE datetime       查询以结束日期截止的单据,当单号为空时,日期必填
单据部门 DEP string 8     多个部门,加中括号[],以逗号隔开,不含下属部门,如”DEP”:”[01],[02]”;单个部门,不用中括号,有含下属
排序 ORDER_BY         例如:
“ORDER BY”:{“TC_NO”:”DESC”,      “CUS_NO”:”ASC”}

请求JSON示例

{
  "PGM":"MRPBR",   //程序代号
  "TC_NO":"",   //按单号查询,可多张单号,加中括号[],单号之间用豆号隔开
  "DATE_TYPE":0,        //0表示单据日期,1表示制单日期,2表示终审日期,3修改日期
  "START_DATE":"2021-01-01",  //查询的开始日期
  "END_DATE":"2021-12-31",   //查询的结束日期
  "DEP":"00000000",      //有[]表示多选,不含下属部门;没有[]表示单选且含下属
  "ORDER_BY":{        //排序规则
      "TC_NO":"DESC",   //DESC表示降序排序
      "CUS_NO":"ASC"    //ASC表示升序排序
  }
}

返回结果示例

{
    "code": 0,    //0值表示执行成功,其他值则表示失败
    "message": "查询成功",
    "data": {
        "UP_DD": "2021-10-28 11:07:32",
        "TOTAL_NUM": 1,
        "BILL_LIST": [         //请求批量查询返回的单据明细信息
            {
                "MF_TC": [
                    {
                        "TC_NO": "TC2110280001",
                        "TC_DD": "2021-10-28 00:00:00",
                        "DEP": "965",
                        "CUS_NO": "CU0801",
                        "TB_NO": "TB2110280001",
                        "BAT_NO": "",
                        "SAL_NO": "YS0101",
                        "TAX_ID": "3",
                        "VOH_ID": "",
                        "USR": "ADMIN",
                        "CHK_MAN": "ADMIN",
                        "CLOSE_ID": "F",
                        "PAY_DD": "2021-11-01 00:00:00",
                        "CHK_DD": "2021-12-01 00:00:00",
                        "INV_NO": "2021110401",
                        "SEND_MTH": "1",
                        "SEND_WH": "",
                        "RP_NO": "",
                        "ZHANG_ID": "1",
                        "CUR_ID": "",
                        "EXC_RTO": 1.00000000,
                        "ARP_NO": "AP2110280006",
                        "PAY_MTH": "1",
                        "PAY_DAYS": 1,
                        "CHK_DAYS": 30,
                        "INT_DAYS": 30,
                        "PAY_REM": "结帐期:2021-11-01;票据到期日:2021-12-01",
                        "PRT_SW": "N",
                        "CLS_REM": "",
                        "CLS_DATE": "2021-10-28 00:00:00",
                        "TC_ID": "T",
                        "BIL_TYPE": "",
                        "KP_ID": "F",
                        "LZ_CLS_ID": "T",
                        "MMVOH_ID": "",
                        "MOB_ID": "",
                        "SYS_DATE": "2021-10-28 11:07:32",
                        "CAS_NO": "",
                        "CUS_OS_NO": "",
                        "PRT_USR": "",
                        "INV_BIL_ID": "LI",
                        "INV_BIL_NO": "LI2111040001"
                    }
                ],
                "TF_TC": [
                    {
                        "ITM": 1,
                        "PRD_NO": "WDP001",
                        "WH": "YH001",
                        "UNIT": "1",
                        "QTY": 1.00000000,
                        "UP": 100.00000000,
                        "AMT": 100.00000000,
                        "AMTN_NET": 100.00000000,
                        "TAX": 5.00000000,
                        "TB_NO": "TB2110280001",
                        "TW_NO": "TW2110280001",
                        "BAT_NO": "",
                        "ID_NO": "WDP001->",
                        "QTY1": 2.00000000,
                        "UP_QTY1": 50.00000000,
                        "TC_NO": "TC2110280001",
                        "VALID_DD": "2021-11-26 00:00:00",
                        "PAK_EXC": 5.00000000,
                        "PAK_UNIT": "0.20箱",
                        "PAK_NW": 0.20000000,
                        "PAK_WEIGHT_UNIT": "台",
                        "PAK_GW": 0.40000000,
                        "PAK_MEAST": 0.60000000,
                        "PAK_MEAST_UNIT": "件",
                        "EST_ITM": 1,
                        "TC_DD": "2021-10-28 00:00:00",
                        "PRD_MARK": "",
                        "RTO_TAX": 5.00000000,
                        "AMT_FP": 105.00000000,
                        "AMTN_NET_FP": 100.00000000,
                        "TAX_FP": 5.00000000,
                        "MM_NO": "MM2110280003",
                        "PRE_ITM": 1,
                        "CUS_OS_NO": "",
                        "PRD_NAME": "打印机",
                        "DZ_USR": "ADMIN",
                        "DZ_DATE": "2021-10-28 11:08:59",
                        "SPC": "H&P",
                        "CHUW": ""
                    }
                ],
                "BILL_STATE": {
                    "READONLY": true,
                    "READONLY_REM": [
                        "已开立发票立帐不能修改"
                    ]
                }
            }
        ]
    }
}